package chapter04;

/**
 * ClassName: OddEvenNumber
 * Package: chapter04
 * Description:
 *
 * @Author fjorid
 * @Create 2025/2/17 19:14
 * @Version 1.0
 */
public class OddEvenNumber {
    public static void main(String[] args) {
        int array[] = {1,2,3,4,5,6,7,8,9,10};
        int count = 0;
        //计算偶数个数
        System.out.println("偶数个数为");
        for (int i = 0; i < array.length; i++) {
            if(array[i] %2 == 0){
                count++;
            }
        }
        System.out.println(count+"\t");
        //计算奇数个数
        System.out.println("奇数个数为");
        count = 0;
        for (int i = 0; i < array.length; i++) {
            if(array[i] %2 != 0){
               count++;
            }
        }
        System.out.println(count);
    }
}
